package me.shan.swap;

/**
 * @author liuchuang
 * @version 1.0
 * @since 2023/5/8 14:26
 */
public class Swap {

    public static void swap(int[] array, int i, int j) {
        array[i] = array[i] ^ array[j];
        array[j] = array[i] ^ array[j];
        array[i] = array[i] ^ array[j];
    }

    public static void main(String[] args) {
        int[] array = {69, 45};
        swap(array, 0, 1);
        System.out.printf("%d, %d\n", array[0], array[1]);
    }

}
